<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<!-- _login_page_ --><!--登录超时标记 勿删-->
<html>
<head>
	<link rel="stylesheet" type="text/css" href="${ctxStatic1}/webpage/static/fonts/iconic/css/material-design-iconic-font.min.css">
	<link rel="stylesheet" type="text/css" href="${ctxStatic1}/webpage/static/css/util.css">
	<link rel="stylesheet" type="text/css" href="${ctxStatic1}/webpage/static/css/main.css">
	<meta name="decorator" content="ani"/>
	<style>
		.box-c{
			z-index: 11;
			position: absolute;
			left: 0;
			right: 0;
			bottom: 0;
		}
		.box-c p{
			margin-bottom: 30px;
			text-align: center;
			color: #fff;
		}
	</style>
	<%-- <title>${fns:getConfig('productName')} 登dd录</title> 页面标题--%>
	<title>${fns:getConfig("productName")}</title>
	<script>
		if (window.top !== window.self) {
			window.top.location = window.location;
		}
	</script>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#loginForm").validate({
				<%--rules: {--%>
				<%--validateCode: {remote: "${pageContext.request.contextPath}/servlet/validateCodeServlet"}--%>
				<%--},--%>
				messages: {
					username: {: "请填写用户名."},password: {: "请填写密码."}
					// validateCode: {remote: "验证码不正确.", : "请填写验证码."}
				},
				errorLabelContainer: "#messageBox",
				errorPlacement: function(error, element) {
					error.appendTo($("#loginError").parent());
				}
			});
		});
		// 如果在框架或在对话框中，则弹出提示并跳转到首页
		if(self.frameElement && self.frameElement.tagName == "IFRAME" || $('#left').length > 0){
			alert('未登录或登录超时。请重新登录，谢谢！');
			top.location = "${ctx}";
		}
	</script>

</head>


<body>
<div class="limiter">
	<div class="container-login100">
		<div class="wrap-login100 p-l-55 p-r-55 p-t-65 p-b-54">
			<form id="loginForm" role="form" action="${ctx}/loginen" method="post" class="login100-form validate-form">
				<div>
					<span class="login100-form-title p-b-19">${fns:getConfig("productName")}</span>
						<div class="wrap-input100 validate-input m-b-23" data-validate="请输入username">
							<span class="label-input100">username</span>
							<input class="input100" AutoComplete="off" type="text" id="username" name="username" placeholder="请输入username" autocomplete="off">
							<span class="focus-input100" data-symbol="&#xf206;"></span>
						</div>

				<div class="wrap-input100 validate-input" data-validate="请输入password">
					<span class="label-input100">passwordspan>
					<input class="input100" AutoComplete="off" type="password" id="password" name="password" placeholder="请输入password">
					<span class="focus-input100" data-symbol="&#xf190;"></span>
				</div>
				<div class="container-login100-form-btn">
					<div class="wrap-login100-form-btn">
						<div class="login100-form-bgbtn"></div>
						<button id="yes_login" onclick="login()" class="login100-form-btn">login</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</div><%--
<div class="box-c">
	<p><a href="http://beian.miit.gov.cn/" target="_blank"> 晋公网安备 14102102000138号</a></p>
</div>--%>
<script src="${ctxStatic1}/webpage/static/js/main.js"></script>

<script>

	$(function () {
		if('${message}' != ''){
			top.layer.msg("${message}", {icon: "danger"});
			if('${message}'.startsWith("License")){
				var s = "<a style=\"color: red;margin-top: 2px;\" href=\"javascript:void(0)\" onclick=\"getMechine()\">获取机器码</a>";

				$("#yes_login").append(s);
			}
		}
	})

	$(document).on("keydown",function (event) {
		var e = event || window.event ||arguments.callee.caller.arguments[0];
		if(e && e.keyCode == 13){
			login();
		}
	});

	function login() {
		jp.loading("登录中...");
		// $("#loginForm").submit();
		jp.ajaxForm("#inputForm",function(data){
			if(data.success){
				// jp.success(data.msg);
				<%--jp.go("${ctx}/buzz/billystk/billYsfj");--%>
			}else{
				jp.error(data.msg);
				$("#inputForm").find("button:submit").button("reset");
			}
		});
	}

	/**
	 * 获取机器码
	 */
	function getMechine(){
		$.get('${ctx}/getMechine',function(result){
			if(result.success){
				prompt("机器码",result.msg);
			}else {
				jp.error(result.msg);
			}
		});
	}
</script>
</body>
</html>
